﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Company_Default : System.Web.UI.Page
{
    public string CompanyName, keywords, p_title;
    public string UserID;
    public string mContent;
    int uid;
    protected void Page_Load(object sender, EventArgs e)
    {


        if (Request.QueryString["p_UserID"] != null)
        {
            uid = int.Parse(Request.QueryString["p_UserID"]);
        }


        DataTable dt = Class1.ExecSel("select * from wj_User where wj_ID=" + uid + "");
        CompanyName = Convert.ToString(dt.Rows[0]["wj_CompanyName"].ToString());
        UserID = Convert.ToString(dt.Rows[0]["wj_ID"].ToString());
        keywords = Convert.ToString(dt.Rows[0]["wj_keywords"].ToString());
        if (dt.Rows[0]["wj_Content"].ToString().Length > 180)
        {
            mContent = Convert.ToString(dt.Rows[0]["wj_Content"].ToString()).Substring(0, 180).Trim() + "...";
        }
        else
        {
            mContent = Convert.ToString(dt.Rows[0]["wj_Content"].ToString());
        }
        DataTable dt2 = Class1.ExecSel("select top 10 * from Product where p_UserID=" + uid + " order by p_ID desc");
        dl_gy.DataSource = dt2;
        dl_gy.DataKeyField = "p_ID";
        dl_gy.DataBind();
        

        DataTable dt3 = Class1.ExecSel("select * from Product where p_UserID=" + uid + " order by p_ID desc");
        dl_gd.DataSource = dt3;
        dl_gd.DataBind();
    }

}
